home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / OUI / ciall < prev    next >
Encoding:
Text File  |  1998-04-08  |  2.4 KB  |  76 lines

  1. .Key AppName/A
  2. .Bra {
  3. .Ket }
  4.  
  5. ; $Id: ciall 1.4 1997/10/06 20:08:42 dlorre Exp dlorre $
  6. ; CiAll : Does CI automatically for an application
  7. ; To make it work, you will have first to initialize with :
  8.  
  9. ; Day2Var lastciAppName
  10.  
  11. ; where AppName is the name of your application
  12. ; The Day2Var program makes two environnement variables storing the current
  13. ; date and the current time and use the given prefix for their name
  14. Day2Var Now
  15.  
  16. ; this scripts are created automatically but could also be stored
  17. ; permanently in S:, they are required because lformat arguments
  18. ; and variable contents are expanded in the first call.
  19.  
  20. Echo CiAll for {AppName}
  21.  
  22. ; GetDate stores the date of the given file into the variable ftime
  23. ; It is now a C program
  24.  
  25. ; RecDate changes the given file date with the contents of the variable ftime
  26. ; It is now a C program
  27.  
  28. ; WaitMore will keep the process waiting until the More command is finished.
  29. Echo > RAM:WaitMore "Lab Check*NStatus > NIL: COM=More*NIf NOT WARN*NWait 5 SECS*NSkip BACK Check*NEndif"
  30.  
  31.  
  32. Protect RAM:WaitMore +s
  33.  
  34. ; Due to C:List limitation we cannot check both date and time so we check
  35. ; which variable to use
  36.  
  37. IF $Nowdate EQ $lastci{AppName}date
  38. SetEnv CheckIt $lastci{AppName}time
  39. Else
  40. SetEnv CheckIt $lastci{AppName}date
  41. Endif
  42.  
  43. ; This complicate list command does :
  44. ; - seeks for .c or .h files
  45. ; - look only the files modified since $CheckIt
  46. ; - creates a script file named ram:aze
  47.  
  48. ; The script file does :
  49. ;  - rcsdiff on the file
  50. ;  - display the results with RUN:more (for having a separate window,
  51. ;    else use only more)
  52. ;  - get the file date
  53. ;  - operates ci -l on the file (then the file date has changed)
  54. ;  - restore the file date
  55.  
  56. list > ram:aze PAT=#?.(cc|h) SINCE $CheckIt LFORMAT "rcsdiff %P%N > ram:bre*NRUN more ram:bre*Ngetdate %P%N ftime*NWaitMore*N ci -l %P%N*Nrecdate %P%N ftime"
  57. execute ram:aze
  58.  
  59. ; supposing you have multiple directories, you have to cd
  60. ; and replicate the command
  61. cd include
  62. list > ram:aze PAT=#?.(h) SINCE $CheckIt LFORMAT "rcsdiff %P%N > ram:bre*NRUN more ram:bre*Ngetdate %P%N ftime*NWaitMore*N ci -l %P%N*Nrecdate %P%N ftime"
  63. execute ram:aze
  64. cd gadgets
  65. list > ram:aze PAT=#?.(h) SINCE $CheckIt LFORMAT "rcsdiff %P%N > ram:bre*NRUN more ram:bre*Ngetdate %P%N ftime*NWaitMore*N ci -l %P%N*Nrecdate %P%N ftime"
  66. execute ram:aze
  67. cd //
  68.  
  69. ; Now our project has a new ci date
  70. Day2Var lastci{AppName}
  71.  
  72. ; Some cleanup
  73. Delete RAM:getdate RAM:recdate RAM:WaitMore QUIET
  74. Delete ENV:ftime RAM:aze RAM:bre QUIET
  75. ; Et voilĂ  !
  76.